package cn.zbacm.api.user.repository;

import cn.zbacm.api.user.entity.User;
import cn.zbacm.api.user.entity.UserSession;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface UserSessionRepository extends PagingAndSortingRepository<UserSession, Integer> {
  boolean existsByTokenAndIsDisabledTrue(String token);

  List<UserSession> findByUserAndIsDisabledFalse(User user);
}
